home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC / include / wcealt.inl < prev    next >
Encoding:
Text File  |  1999-02-19  |  4.2 KB  |  175 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. #ifndef __WCEALT_INL__ 
  12. #define __WCEALT_INL__
  13.  
  14. inline BOOL wce_LockWindowUpdate(HWND hWnd) 
  15. {
  16.     return TRUE;
  17. }
  18.  
  19. inline UINT wce_IsDlgButtonChecked(HWND hDlg, int nIDButton)
  20. {
  21.     return (UINT)::SendMessage(::GetDlgItem(hDlg, nIDButton), BM_GETCHECK, 0L, 0L);
  22. }
  23.  
  24. inline BOOL wce_SetDlgItemText(HWND hDlg, int nIDDlgItem, LPCWSTR lpString)
  25. {
  26.     return ::SetWindowText(GetDlgItem(hDlg,nIDDlgItem),lpString);
  27. }
  28.  
  29. inline LONG wce_SendDlgItemMessage(HWND hDlg, int nIDDlgItem, UINT uMsg, WPARAM wParam, LPARAM lParam)
  30. {
  31.     return (long)SendMessage(GetDlgItem(hDlg, nIDDlgItem), uMsg, wParam, lParam);
  32. }
  33.  
  34. inline UINT wce_GetDlgItemText(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
  35. {
  36.     return ::GetWindowText(GetDlgItem(hDlg, nIDDlgItem), lpString, nMaxCount);
  37. }
  38.  
  39. inline void wce_CheckDlgButton(HWND hDlg, int nIDButton, UINT uCheck)
  40. {
  41.     ::SendMessage(::GetDlgItem(hDlg, nIDButton), BM_SETCHECK, uCheck, 0);
  42. }
  43.  
  44. inline BOOL wce_IsIconic(HWND hWnd)
  45. {
  46.     return !IsWindowEnabled(hWnd);
  47. }
  48.  
  49. inline HWND wce_GetTopWindow(HWND hWnd)
  50. {
  51.     return ::GetWindow(hWnd, GW_CHILD);
  52. }
  53.  
  54. inline HWND wce_GetNextWindow(HWND hWnd, UINT nDirection)
  55.     return ::GetWindow(hWnd, nDirection); 
  56. }
  57.  
  58. inline HWND wce_GetDesktopWindow()
  59. {
  60.     return HWND_DESKTOP;
  61. }
  62.  
  63. inline HWND wce_GetLastActivePopup(HWND hWnd)
  64. {
  65.     return ::GetActiveWindow();
  66. }
  67.  
  68. inline BOOL wce_ScrollWindow(HWND hWnd, int xAmount, int yAmount, LPCRECT lpRect, LPCRECT lpClipRect)
  69. {
  70.     return (ERROR != ::ScrollWindowEx(hWnd, xAmount, yAmount, lpRect, lpClipRect, 
  71.                                        NULL, NULL, SW_INVALIDATE | SW_ERASE));
  72. }
  73.  
  74. inline BOOL wce_IsMenu(HMENU hMenu)
  75. {
  76.     MENUITEMINFO mii;
  77.     memset((char*)&mii, 0, sizeof(MENUITEMINFO));
  78.     mii.cbSize = sizeof(MENUITEMINFO);
  79.     if (GetMenuItemInfo(hMenu, 0, TRUE, &mii))
  80.         return TRUE;
  81.     else
  82.         return (GetLastError() == 0);
  83. }
  84.  
  85. inline BOOL wce_TrackPopupMenu(HMENU hMenu, UINT uFlags, int x, int y, int nReserved, HWND hWnd, CONST RECT *prcRect)
  86. {
  87.     return(::TrackPopupMenuEx(hMenu, uFlags, x, y, hWnd, NULL));
  88. }
  89.  
  90. inline BOOL wce_InvertRect(HDC hdc, const RECT* lprc)
  91. {
  92.     return ::PatBlt(hdc, lprc->left, lprc->top,
  93.                          lprc->right - lprc->left,
  94.                          lprc->bottom - lprc->top, DSTINVERT);
  95. }
  96.  
  97. inline int wce_GetMapMode(HDC hdc)
  98. {
  99.     if (hdc == NULL) 
  100.         return 0;
  101.     return MM_TEXT;    // the only mapping mode 
  102. }
  103.  
  104. inline BOOL wce_GetViewportOrgEx(HDC hdc, LPPOINT lpPoint)
  105.     if (hdc == NULL)
  106.         return FALSE; 
  107.     lpPoint->x = 0;        // origin is always (0,0) 
  108.     lpPoint->y = 0;
  109.     return TRUE;
  110. }
  111.  
  112. inline BOOL wce_GetViewportExtEx(HDC hdc, LPSIZE lpSize)
  113.     if (hdc == NULL)
  114.         return FALSE; 
  115.     lpSize->cx = 1;        // extent is always 1,1 
  116.     lpSize->cy = 1;
  117.     return TRUE;
  118. }
  119.  
  120. inline BOOL wce_GetWindowOrgEx(HDC hdc, LPPOINT lpPoint)
  121.     if (hdc == NULL)
  122.         return FALSE; 
  123.     lpPoint->x = 0;        // origin is always (0,0) 
  124.     lpPoint->y = 0;
  125.     return TRUE;
  126. }
  127.  
  128. inline BOOL wce_GetWindowExtEx(HDC hdc, LPSIZE lpSize)
  129.     if (hdc == NULL)
  130.         return FALSE; 
  131.     lpSize->cx = 1;        // extent is always 1,1 
  132.     lpSize->cy = 1;
  133.     return TRUE;
  134. }
  135.  
  136. inline BOOL wce_DPtoLP(HDC hdc, LPPOINT lpPoints, int nCount)
  137.     if (hdc == NULL)
  138.         return FALSE;
  139.     return TRUE; // DP = LP always 
  140. }
  141.  
  142. inline BOOL wce_LPtoDP(HDC hdc, LPPOINT lpPoints, int nCount)
  143.     if (hdc == NULL)
  144.         return FALSE;
  145.     return TRUE; // DP = LP always 
  146. }
  147.  
  148. inline BOOL wce_DrawIcon(HDC hDC, int X, int Y, HICON hIcon)
  149. {
  150.     return ::DrawIconEx(hDC, X, Y, hIcon, 0, 0, 0,NULL, DI_NORMAL);
  151. }
  152.  
  153. inline HCURSOR wce_LoadCursor(HINSTANCE hInstance,LPCWSTR lpCursorName)
  154. {
  155.     return ::LoadCursorW(hInstance, lpCursorName);
  156. }
  157.  
  158. inline HBITMAP wce_CreateBitmapIndirect(LPBITMAP lpBitmap)
  159. {
  160.     return ::CreateBitmap(lpBitmap->bmWidth,
  161.                           lpBitmap->bmHeight,
  162.                           lpBitmap->bmPlanes,
  163.                           lpBitmap->bmBitsPixel,
  164.                           lpBitmap->bmBits);
  165. }
  166.  
  167. #endif // __WCEALT_INL__
  168.